/*
 * @Author: XieQiu 雪球
 * @Date: 2021-05-20 10:47:33
 * @LastEditTime: 2022-03-18 14:42:07
 * @LastEditors: Please set LastEditors
 * @Description: 员工管理接口
 */
import xjaxios from "@/api/axios";

export default {
  /**
   * @description: 获取员工列表 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
   */
  getStaffList(params) {
    return xjaxios.post("v3/organization/personDepartmentMapper/queryPageByCondition", params);
  },
  // /**
  //  * @description: 条件查询所有员工
  //  * @param null *
  //  * @return {Object}
  //  */
  getStaffListByCondition(params) {
    return xjaxios.post("v3/organization/personDepartmentMapper/queryByCondition", {
      organizationNo: sessionStorage.organizationNo,
      personNo: params
    });
  },
  /**
   * @description: 新增员工信息
   * @param {Object} formData *
   * @return {Object}
   */
  addStaffInfo(formData) {
    // formData.organizationNo = sessionStorage.baseId;
    return xjaxios.post("v3/organization/personDepartmentMapper/add", formData);
  },
  /**
   * @description: 编辑员工信息
   * @param {Object} formData *
   * @return {Object}
   */
  editStaffInfo(formData) {
    return xjaxios.post("v3/organization/personDepartmentMapper/edit", formData);
  },
  /**
   * @description: 单个删除员工
   * @param {String} employeeId *
   * @return {Array}
   */
  delStaffById(employeeId) {
    return xjaxios.get(`v3/organization/personDepartmentMapper/delByEmployeeNo?no=${employeeId}`);
  },
  delListStaffById(employeeId) {
    return xjaxios.get(`v3/organization/personDepartmentMapper/delListByEmployeeNo?noList=${employeeId}`);
  },
  // 上传excel
  employeeImportExcel(fileFormData) {
    return xjaxios.post('v3/organization/employee/importExcel', fileFormData)
  },
  // 下载excel
  employeeExpensesDownExcel(params) {
    return xjaxios.post("v3/organization/employee/downExcel", params, { responseType: 'arraybuffer' });
  },
  // getStaffqueryAllCondition() {
  //   return xjaxios.get("v3/organization/employee/queryAll");
  // },
  /**
   * @description: 获取所有巡查点列表 *代表必填
   * @param {String} organizationNo *
   * @return {Array}
   */
  // getInspectionPointList() {
  //   return xjaxios.post("v3/organization/inspectionPoint/queryByCondition", {
  //     organizationNo: sessionStorage.organizationNo
  //   });
  // },
  /**
   * @description: 新增用户信息
   * @param {Object} formData *
   * @return {Object}
   */
  addUserInfo(formData) {
    formData.organizationNo = sessionStorage.organizationNo;
    // formData.systemMark = "OM1";
    return xjaxios.post("v3/organization/user/add", formData);
  },
  // 审核
  auditUserByConditio(formData) {
    // formData.systemMark = "OM1";
    return xjaxios.post(`v3/person/auditUser/queryPageByCondition`, formData);
  },
  // 审核
  auditUserStatus(formData) {
    // formData.systemMark = "OM1";
    return xjaxios.post(`v3/person/auditUser/editAuditStatus`, formData);
  }
  // /**
  //  * @description: 批量删除数据
  //  * @param {Array} list *
  //  * @return {Object}
  //  */
  // delInspectionRouteInfo(list) {
  //   return xjaxios.post("v3/organization/inspectionRoute/delList", {
  //     inspectionRouteIdList: list
  //   });
  // }
};
